package me.midday.java.base.knowledge.mutlthread;

public class FirstThread extends Thread{

    private  int i;


    @Override
    public void run() {
        for(; i< 100; i++){
            System.out.println(getName() + " " + i);
        }
    }


    public static void main(String[] args) throws InterruptedException {
        for(int i=0; i< 100; i++){
            System.out.println(Thread.currentThread().getName()+ " " + i);
            if (i == 20){
                Thread t1 = new FirstThread();
                Thread t2 = new FirstThread();
                t1.start();
                t2.start();
            }
        }
    }



}
